<?php

namespace App\Admin\Repositories;

use App\Models\AgricGoods as Model;
use App\Models\AgricGoodsSeller;
use Dcat\Admin\Repositories\EloquentRepository;

class AgricGood extends EloquentRepository
{
    /**
     * Model.
     *
     * @var string
     */
    protected $eloquentClass = Model::class;

    /**
     * 获得已有卖家信息
     * @return array
     */
    public static function getSellerList()
    {
        $seller = AgricGoodsSeller::get();
        $res = [];
        foreach ($seller as $sellerVal) {
            $res[$sellerVal->id] = $sellerVal->seller_name.'-'.$sellerVal->seller_num;
        }

        return $res;
    }

}
